home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / mac / textures / graphics / psboxall.tex < prev    next >
Text File  |  1994-05-08  |  55KB  |  1,443 lines

  1. %*************************************************************************
  2. %* Jean Orloff                * phone: 49-6221-56.94.14    *
  3. %* Inst. Th. Physik der Uni Heidelberg    * fax:     49-6221-56.93.29    *
  4. %* Philosophenweg 16, D-69000 Heidelberg    * e-mail: fe8@ix.urz.uni-heidelberg.de
  5. %*************************************************************************
  6. % This text was produced with psbox's \joinfiles. You should:
  7. %-save this with a filename CONTAINING ONLY LETTERS
  8. % (say, PSBOXALL.TEX), in some empty directory;
  9. %-tex PSBOXALL.TEX using Plain TeX.
  10. % You will get 6 files:
  11. %   psbox.tex (the macros),
  12. %   psbsamp.tex (the dox & sample file)
  13. %   psbREAD.ME (a quick overview)
  14. %   box.ps (a stupid sample PostScript drawing)
  15. %   psbugs.tex  (a sample bug report file)
  16. %   psboxOK.tex {an anti-bug report file: please send if satisfied!)
  17. % and furthermore do the equivalent of TeXing psbsamp.tex.
  18. %Beginning-Of-File-Named:psbox.tex
  19. %
  20. %       %%%%%%%    %%%%%        %%%%%%    %%%%%   %     %
  21. %       %      %  %             %     %  %     %   %   %
  22. %       %      %  %             %     %  %     %    % %
  23. %       %%%%%%%    %%%%%        %%%%%%   %     %     %
  24. %       %               %       %     %  %     %    % %
  25. %       %               %       %     %  %     %   %   %
  26. %       %         %%%%%%        %%%%%%    %%%%%   %     %
  27. %
  28. %       By Jean Orloff
  29. %       Comments & suggestions by e-mail: fe8@ix.urz.uni-heidelberg.de
  30. %       No modification of this file allowed if not e-sent to me.
  31. %
  32. % WHAT IS IT:
  33. % psbox is a set of machine-independent TeX macros to
  34. % 1) allow (Encapsulated) PostScript figure inclusion in all versions
  35. %    of TeX (Plain, LaTeX) on all machines using a PostScript printer
  36. % 2) facilitate the communication (e-mail, ftp, ...) of all the files
  37. %    (text, macros, figs) needed to reproduce a TeX document by grouping
  38. %    them together into a single, TeXable file.
  39. % For more info, get the file pub/TeX/psbox/PSBOXALL.TEX by anonymous
  40. %     ftp from cs.nyu.edu(=128.122.140.24)
  41. %
  42. % History:
  43. %  1.35: \warnopenout message; \psnewinput, OzTeX & dvitps final fixes
  44. %  1.34: \readfilename=final fix for all filename scans; try \psforptips
  45. %  1.33: corrects \psnewinput for LaTeX (still fails if fname=a{b}c)
  46. %  1.32: corrects \psfordvialw and adds .TEX to PSBOXALL(!)
  47. %  1.31: adds \psfordvialw(?)
  48. %  1.30: adds \splitfile & \joinfiles for multi-file management
  49. %  1.24: fix error handling & add \psonlyboxes
  50. %  1.22: makes \drawingBox \global for use in Phyzzx
  51. %  1.21: accepts %%BoundingBox: (atend)
  52. %  1.20: tries to add \psfordvitps for the TeXPS package.
  53. %  1.10: adds \psforoztex, error handling...
  54. %2345678 1 2345678 2 2345678 3 2345678 4 2345678 5 2345678 6 2345678 7 23456789
  55. %
  56. % Checking version no to avoid multiple loadings
  57. \def\temp{1.35}%
  58. \let\tempp=\relax
  59. \expandafter\ifx\csname psboxversion\endcsname\relax
  60.   \message{PSBOX(\temp)}%
  61. \else
  62.     \ifdim\temp cm>\psboxversion cm
  63.       \message{PSBOX(\temp)}%
  64.     \else
  65.       \message{PSBOX(\psboxversion) is already loaded: I won't load
  66.         PSBOX(\temp)!}%
  67.       \let\temp=\psboxversion
  68.       \let\tempp=\endinput
  69.     \fi
  70. \fi
  71. \tempp
  72. \message{by Jean Orloff: loading ...}
  73. \let\psboxversion=\temp
  74. \catcode`\@=11
  75. % Every macro likes a little privacy...
  76. %
  77. %Trying to tame the variety of \special commands for Postscript: the
  78. %  universal internal command \PSspeci@l##1##2 takes ##1 to be the
  79. %  filename and ##2 to be the integer scale factor*1000 (as for usual
  80. %   TeX \scale commands)
  81. %
  82. \def\psfortextures{%     For TeXtures on the Macintosh
  83. %-----------------
  84. \def\PSspeci@l##1##2{%
  85. \special{illustration ##1\space scaled ##2}%
  86. }}%
  87. \def\psfordvitops{%      For the DVItoPS converter on IBM mainframes
  88. %----------------
  89. \def\PSspeci@l##1##2{%
  90. \special{dvitops: import ##1\space \the\drawingwd \the\drawinght}%
  91. }}%
  92. \def\psfordvips{%      For DVIPS converter on VAX, UNIX and PC's
  93. %--------------
  94. \def\PSspeci@l##1##2{%
  95. %    \special{/@scaleunit 1000 def}% never read dox without trying!
  96. \d@my=0.1bp \d@mx=\drawingwd \divide\d@mx by\d@my% BUG! for large \drawingwd
  97. \special{PSfile=##1\space llx=\psllx\space lly=\pslly\space%
  98. urx=\psurx\space ury=\psury\space rwi=\number\d@mx
  99. }}}%
  100. \def\psforoztex{%        For the OzTeX shareware on the Macintosh
  101. %--------------
  102. \def\PSspeci@l##1##2{%
  103. \special{##1 \space
  104.       ##2 1000 div dup scale
  105.       \number-\psllx\space\space \number-\pslly\space\space translate
  106. }}}%
  107. \def\psfordvitps{%       From the UNIX TeXPS package, vers.>3.12
  108. %---------------
  109. \def\dvitpsLiter@ldim##1{\dimen0=##1\relax
  110. \special{dvitps: Literal "\number\dimen0\space"}}%
  111. \def\PSspeci@l##1##2{%
  112. % psfig.psr contains the def of "startTexFig": if you can locate it
  113. % and put it somewhere in the TEXINPUTS path, this works
  114. \at(0bp;\drawinght){%
  115. \special{dvitps: Include0 "psfig.psr"}% contains def of "startTexFig"
  116. \dvitpsLiter@ldim{\drawingwd}%
  117. \dvitpsLiter@ldim{\drawinght}%
  118. \dvitpsLiter@ldim{\psllx bp}%
  119. \dvitpsLiter@ldim{\pslly bp}%
  120. \dvitpsLiter@ldim{\psurx bp}%
  121. \dvitpsLiter@ldim{\psury bp}%
  122. \special{dvitps: Literal "startTexFig"}%
  123. \special{dvitps: Include1 "##1"}%
  124. \special{dvitps: Literal "endTexFig"}%
  125. }}}%
  126. \def\psfordvialw{%   Try for dvialw, a UNIX public domain
  127. %---------------
  128. \def\PSspeci@l##1##2{
  129. \special{language "PostScript",
  130. position = "bottom left",
  131. literal "  \psllx\space \pslly\space translate
  132.   ##2 1000 div dup scale
  133.   -\psllx\space -\pslly\space translate",
  134. include "##1"}
  135. }}%
  136. \def\psforptips{%   For MS-DOS; LUOMA@brandeis.bitnet
  137. %---------------
  138. \def\PSspeci@l##1##2{{
  139. \d@mx=\psurx bp
  140. \advance \d@mx by -\psllx bp
  141. \divide \d@mx by 1000\multiply\d@mx by \xscale
  142. \incm{\d@mx}
  143. \let\tmpx\dimincm
  144. \d@my=\psury bp
  145. \advance \d@my by -\pslly bp
  146. \divide \d@my by 1000\multiply\d@my by \xscale
  147. \incm{\d@my}
  148. \let\tmpy\dimincm
  149. \d@mx=-\psllx bp
  150. \divide \d@mx by 1000\multiply\d@mx by \xscale
  151. \d@my=-\pslly bp
  152. \divide \d@my by 1000\multiply\d@my by \xscale
  153. \at(\d@mx;\d@my){\special{ps:##1 x=\tmpx cm, y=\tmpy cm}}
  154. }}}%
  155. \def\psonlyboxes{%     Draft-like behaviour if none of the others works
  156. %---------------
  157. \def\PSspeci@l##1##2{%
  158. \at(0cm;0cm){\boxit{\vbox to\drawinght
  159.   {\vss\hbox to\drawingwd{\at(0cm;0cm){\hbox{({\tt##1})}}\hss}}}}
  160. }}%
  161. \def\psloc@lerr#1{%
  162. \let\savedPSspeci@l=\PSspeci@l%
  163. \def\PSspeci@l##1##2{%
  164. \at(0cm;0cm){\boxit{\vbox to\drawinght
  165.   {\vss\hbox to\drawingwd{\at(0cm;0cm){\hbox{({\tt##1}) #1}}\hss}}}}
  166. \let\PSspeci@l=\savedPSspeci@l% restore normal output for other figs!
  167. }}%
  168. %\def\psfor...  add your own!
  169. %
  170. % Some common defs
  171. %
  172. \newread\pst@mpin
  173. \newdimen\drawinght\newdimen\drawingwd
  174. \newdimen\psxoffset\newdimen\psyoffset
  175. \newbox\drawingBox
  176. \newcount\xscale \newcount\yscale \newdimen\pscm\pscm=1cm
  177. \newdimen\d@mx \newdimen\d@my
  178. \newdimen\pswdincr \newdimen\pshtincr
  179. \let\ps@nnotation=\relax
  180. {\catcode`\|=0 |catcode`|\=12 |catcode`|%=12 |catcode`~=12
  181. |catcode`#=12 |catcode`*=14
  182. |xdef|backslashother{\}*
  183. |xdef|percentother{%}*
  184. |xdef|tildeother{~}*
  185. |xdef|sharpother{#}*
  186. }%
  187. % useful to display special chars in \tt; fails for \,#,%
  188. \def\R@moveMeaningHeader#1:->{}%
  189. \def\uncatcode#1{%
  190. \edef#1{\expandafter\R@moveMeaningHeader\meaning#1}}%
  191. %
  192. \def\execute#1{#1}% NOT stupid: cs in #1 are then identified BEFORE execution
  193. \def\psm@keother#1{\catcode`#112\relax}% borrowed from latex
  194. \def\executeinspecs#1{%
  195. \execute{\begingroup\let\do\psm@keother\dospecials\catcode`\^^M=9#1\endgroup}}%
  196. \def\@mpty{}%
  197. % \if\matchin#1#2<=> \iftrue if #1 contains #2, <=>\iffalse otherwise:
  198. % \if\matchexpin: idem, but #1 & #2 are first fully expanded (no \if
  199. % inside!)
  200. % \tmpa & \tmpb contain what's before and after the occurence of #2
  201. \def\matchexpin#1#2{
  202.   \fi%
  203. %\message{(#1>#2)}
  204.   \edef\tmpb{{#2}}%
  205.   \expandafter\makem@tchtmp\tmpb%
  206.   \edef\tmpa{#1}\edef\tmpb{#2}%
  207.   \expandafter\expandafter\expandafter\m@tchtmp\expandafter\tmpa\tmpb\endm@tch%
  208.   \if\match%
  209. }%
  210. \def\matchin#1#2{%
  211.   \fi%
  212.   \makem@tchtmp{#2}%
  213.   \m@tchtmp#1#2\endm@tch%
  214.   \if\match%
  215. }%
  216. \def\makem@tchtmp#1{\def\m@tchtmp##1#1##2\endm@tch{%
  217.   \def\tmpa{##1}\def\tmpb{##2}\let\m@tchtmp=\relax%
  218.   \ifx\tmpb\@mpty\def\match{YN}%
  219.   \else\def\match{YY}\fi%
  220. }}%
  221. % converts any dimen in cm, with 1E-4 cm precision
  222. \def\incm#1{{\psxoffset=1cm\d@my=#1
  223.  \d@mx=\d@my
  224.   \divide\d@mx by \psxoffset
  225.   \xdef\dimincm{\number\d@mx.}
  226.   \advance\d@my by -\number\d@mx cm
  227.   \multiply\d@my by 100
  228.  \d@mx=\d@my
  229.   \divide\d@mx by \psxoffset
  230.   \edef\dimincm{\dimincm\number\d@mx}
  231.   \advance\d@my by -\number\d@mx cm
  232.   \multiply\d@my by 100
  233.  \d@mx=\d@my
  234.   \divide\d@mx by \psxoffset
  235.   \xdef\dimincm{\dimincm\number\d@mx}
  236. }}%
  237. %
  238. %  \ReadPSize{PSfilename} reads the dimensions of a PostScript drawing
  239. %      and stores it in \drawinght(wd)
  240. \newif\ifNotB@undingBox
  241. \newhelp\PShelp{Proceed: you'll have a 5cm square blank box instead of
  242. your graphics.}%
  243. \def\s@tsize#1 #2 #3 #4\@ndsize{
  244.   \def\psllx{#1}\def\pslly{#2}%
  245.   \def\psurx{#3}\def\psury{#4}%  needed by a crazyness of dvips!
  246.   \ifx\psurx\@mpty\NotB@undingBoxtrue% this is not a valid one!
  247.   \else
  248.     \drawinght=#4bp\advance\drawinght by-#2bp
  249.     \drawingwd=#3bp\advance\drawingwd by-#1bp
  250. %  !Units related by crazy factors as bp/pt=72.27/72 should be BANNED!
  251.   \fi
  252.   }%
  253. \def\sc@nBBline#1:#2\@ndBBline{\edef\p@rameter{#1}\edef\v@lue{#2}}%
  254. \def\g@bblefirstblank#1#2:{\ifx#1 \else#1\fi#2}%
  255. {\catcode`\%=12
  256. \xdef\B@undingBox{%%BoundingBox}}%
  257. %% is not a true comment in PostScript, even if % is!
  258. \def\ReadPSize#1{
  259.  \readfilename#1\relax
  260.  \let\PSfilename=\lastreadfilename
  261.  \openin\pst@mpin=#1\relax
  262.  \ifeof\pst@mpin \errhelp=\PShelp
  263.    \errmessage{I haven't found your postscript file (\PSfilename)}%
  264.    \psloc@lerr{was not found}%
  265.    \s@tsize 0 0 142 142\@ndsize
  266.    \closein\pst@mpin
  267.  \else
  268. % each entry in \GlobalInputList should be unique
  269.    \if\matchexpin{\GlobalInputList}{, \lastreadfilename}%
  270.    \else\xdef\GlobalInputList{\GlobalInputList, \lastreadfilename}%
  271.      \immediate\write\psbj@inaux{\lastreadfilename,}%
  272.    \fi%
  273.    \loop
  274.      \executeinspecs{\catcode`\ =10\global\read\pst@mpin to\n@xtline}%
  275.      \ifeof\pst@mpin
  276.        \errhelp=\PShelp
  277.        \errmessage{(\PSfilename) is not an Encapsulated PostScript File:
  278.            I could not find any \B@undingBox: line.}%
  279.        \edef\v@lue{0 0 142 142:}%
  280.        \psloc@lerr{is not an EPSFile}%
  281.        \NotB@undingBoxfalse
  282.      \else
  283.        \expandafter\sc@nBBline\n@xtline:\@ndBBline
  284.        \ifx\p@rameter\B@undingBox\NotB@undingBoxfalse
  285.          \edef\t@mp{%
  286.            \expandafter\g@bblefirstblank\v@lue\space\space\space}%
  287.          \expandafter\s@tsize\t@mp\@ndsize
  288.        \else\NotB@undingBoxtrue
  289.        \fi
  290.      \fi
  291.    \ifNotB@undingBox\repeat
  292.    \closein\pst@mpin
  293.  \fi
  294. \message{#1}%
  295. }%
  296. %
  297. % \psboxto(xdim;ydim){psfilename}: you specify the dimensions and
  298. %    TeX uniformly scales to fit the largest one. If xdim=0pt, the
  299. %    scale is fully determined by ydim and vice versa.
  300. %    Notice: psboxes are a real vboxes; couldn't take hbox otherwise all
  301. %    indentation and all cr's would be interpreted as spaces (hugh!).
  302. %
  303. \def\psboxto(#1;#2)#3{\vbox{%
  304.    \ReadPSize{#3}%
  305.    \advance\pswdincr by \drawingwd
  306.    \advance\pshtincr by \drawinght
  307.    \divide\pswdincr by 1000
  308.    \divide\pshtincr by 1000
  309.    \d@mx=#1
  310.    \ifdim\d@mx=0pt\xscale=1000
  311.          \else \xscale=\d@mx \divide \xscale by \pswdincr\fi
  312.    \d@my=#2
  313.    \ifdim\d@my=0pt\yscale=1000
  314.          \else \yscale=\d@my \divide \yscale by \pshtincr\fi
  315.    \ifnum\yscale=1000
  316.          \else\ifnum\xscale=1000\xscale=\yscale
  317.                     \else\ifnum\yscale<\xscale\xscale=\yscale\fi
  318.               \fi
  319.    \fi
  320.    \divide\drawingwd by1000 \multiply\drawingwd by\xscale
  321.    \divide\drawinght by1000 \multiply\drawinght by\xscale
  322.    \divide\psxoffset by1000 \multiply\psxoffset by\xscale
  323.    \divide\psyoffset by1000 \multiply\psyoffset by\xscale
  324.    \global\divide\pscm by 1000
  325.    \global\multiply\pscm by\xscale
  326.    \multiply\pswdincr by\xscale \multiply\pshtincr by\xscale
  327.    \ifdim\d@mx=0pt\d@mx=\pswdincr\fi
  328.    \ifdim\d@my=0pt\d@my=\pshtincr\fi
  329.    \message{scaled \the\xscale}%
  330.  \hbox to\d@mx{\hss\vbox to\d@my{\vss
  331.    \global\setbox\drawingBox=\hbox to 0pt{\kern\psxoffset\vbox to 0pt{%
  332.       \kern-\psyoffset
  333.       \PSspeci@l{\PSfilename}{\the\xscale}%
  334.       \vss}\hss\ps@nnotation}%
  335.    \global\wd\drawingBox=\the\pswdincr
  336.    \global\ht\drawingBox=\the\pshtincr
  337.    \global\drawingwd=\pswdincr
  338.    \global\drawinght=\pshtincr
  339.    \baselineskip=0pt
  340.    \copy\drawingBox
  341.  \vss}\hss}%
  342.   \global\psxoffset=0pt
  343.   \global\psyoffset=0pt
  344.   \global\pswdincr=0pt
  345.   \global\pshtincr=0pt % These are local to one figure
  346.   \global\pscm=1cm %should not be necessary
  347. }}%
  348. %
  349. % \psboxscaled{scalefactor*1000}{PSfilename} allows to bypass the
  350. %   rounding errors of TeX integer divisions for situations where the
  351. %   TeX box should fit the original BoundingBox with a precision
  352. %   better
  353. %   than 1/1000.
  354. %
  355. \def\psboxscaled#1#2{\vbox{%
  356.   \ReadPSize{#2}%
  357.   \xscale=#1
  358.   \message{scaled \the\xscale}%
  359.   \divide\pswdincr by 1000 \multiply\pswdincr by \xscale
  360.   \divide\pshtincr by 1000 \multiply\pshtincr by \xscale
  361.   \divide\psxoffset by1000 \multiply\psxoffset by\xscale
  362.   \divide\psyoffset by1000 \multiply\psyoffset by\xscale
  363.   \divide\drawingwd by1000 \multiply\drawingwd by\xscale
  364.   \divide\drawinght by1000 \multiply\drawinght by\xscale
  365.   \global\divide\pscm by 1000
  366.   \global\multiply\pscm by\xscale
  367.   \global\setbox\drawingBox=\hbox to 0pt{\kern\psxoffset\vbox to 0pt{%
  368.      \kern-\psyoffset
  369.      \PSspeci@l{\PSfilename}{\the\xscale}%
  370.      \vss}\hss\ps@nnotation}%
  371.   \advance\pswdincr by \drawingwd
  372.   \advance\pshtincr by \drawinght
  373.   \global\wd\drawingBox=\the\pswdincr
  374.   \global\ht\drawingBox=\the\pshtincr
  375.   \global\drawingwd=\pswdincr
  376.   \global\drawinght=\pshtincr
  377.   \baselineskip=0pt
  378.   \copy\drawingBox
  379.   \global\psxoffset=0pt
  380.   \global\psyoffset=0pt
  381.   \global\pswdincr=0pt
  382.   \global\pshtincr=0pt % These are local to one figure
  383.   \global\pscm=1cm
  384. }}%
  385. %
  386. %  \psbox{PSfilename} makes a TeX box having the minimal size to
  387. %      enclose the picture
  388. \def\psbox#1{\psboxscaled{1000}{#1}}%
  389. %------------------------------------------------------
  390. %  \joinfiles file1, file2, ...n \into joinedfilename .
  391. %     makes one file out of many
  392. %  \splitfile joinedfilename
  393. %     the opposite
  394. \newif\ifn@teof\n@teoftrue
  395. \newif\ifc@ntrolline
  396. \newif\ifmatch
  397. \newread\j@insplitin
  398. \newwrite\j@insplitout
  399. \newwrite\psbj@inaux
  400. \immediate\openout\psbj@inaux=psbjoin.aux
  401. \immediate\write\psbj@inaux{\string\joinfiles}%
  402. \immediate\write\psbj@inaux{\jobname,}%
  403. %
  404. % INPUT REDEFINITION
  405. %
  406. % works if #1 is a single character
  407. \def\toother#1{\ifcat\relax#1\else\expandafter%
  408.   \toother@ux\meaning#1\endtoother@ux\fi}%
  409. \def\toother@ux#1 #2#3\endtoother@ux{\def\tmp{#3}%
  410.   \ifx\tmp\@mpty\def\tmp{#2}\let\next=\relax%
  411.   \else\def\next{\toother@ux#2#3\endtoother@ux}\fi%
  412. \next}%
  413. %
  414. % \readfilename defs:
  415. %
  416. \let\readfilenamehook=\relax
  417. \def\re@d{\expandafter\re@daux}% spares typing 10 \expandafter's...
  418. \def\re@daux{\futurelet\nextchar\stopre@dtest}%
  419. \def\re@dnext{\xdef\lastreadfilename{\lastreadfilename\nextchar}%
  420.   \afterassignment\re@d\let\nextchar}%
  421. \def\stopre@d{\egroup\readfilenamehook}%
  422. \def\stopre@dtest{%
  423.   \ifcat\nextchar\relax\let\nextread\stopre@d
  424.   \else
  425.     \ifcat\nextchar\space\def\nextread{%
  426.       \afterassignment\stopre@d\chardef\nextchar=`}%
  427.     \else\let\nextread=\re@dnext
  428.       \toother\nextchar
  429.       \edef\nextchar{\tmp}%
  430.     \fi
  431.   \fi\nextread}%
  432. \def\readfilename{\bgroup%
  433.   \let\\=\backslashother \let\%=\percentother \let\~=\tildeother
  434.   \let\#=\sharpother \xdef\lastreadfilename{}%
  435.   \re@d}%
  436. %
  437. % redefines \input using \readfilename
  438. %
  439. \xdef\GlobalInputList{\jobname}%
  440. \def\psnewinput{%
  441.   \def\readfilenamehook{% each entry in \GlobalInputList should be unique
  442.     \if\matchexpin{\GlobalInputList}{, \lastreadfilename}%
  443.     \else\xdef\GlobalInputList{\GlobalInputList, \lastreadfilename}%
  444.       \immediate\write\psbj@inaux{\lastreadfilename,}%
  445.     \fi%
  446.     \let\readfilenamehook=\relax%
  447.     \ps@ldinput\lastreadfilename\relax%
  448.   }\readfilename%
  449. }%
  450. \expandafter\ifx\csname @@input\endcsname\relax    % then Plain
  451.   \immediate\let\ps@ldinput=\input\def\input{\psnewinput}%
  452. \else
  453.   \immediate\let\ps@ldinput=\@@input
  454.   \def\@@input{\psnewinput}%
  455. \fi%
  456. %
  457. \def\nowarnopenout{%
  458.  \def\warnopenout##1##2{%
  459.    \readfilename##2\relax
  460.    \message{\lastreadfilename}%
  461.    \immediate\openout##1=\lastreadfilename\relax}}%
  462. \def\warnopenout#1#2{%
  463.  \readfilename#2\relax
  464.  \def\t@mp{TrashMe,psbjoin.aux,psbjoint.tex,}\uncatcode\t@mp
  465.  \if\matchexpin{\t@mp}{\lastreadfilename,}%
  466.  \else
  467.    \immediate\openin\pst@mpin=\lastreadfilename\relax
  468.    \ifeof\pst@mpin
  469.      \else
  470.      \edef\tmp{{If the content of this file is precious to you, this
  471. is your last chance to abort (ie press x or e) and rename it before
  472. retexing (\jobname). If you're sure there's no file
  473. (\lastreadfilename) in the directory of (\jobname), then go on: I'm
  474. simply worried because you have another (\lastreadfilename) in some
  475. directory I'm looking in for inputs...}}%
  476.      \errhelp=\tmp
  477.      \errmessage{I may be about to replace your file named \lastreadfilename}%
  478.    \fi
  479.    \immediate\closein\pst@mpin
  480.  \fi
  481.  \message{\lastreadfilename}%
  482.  \immediate\openout#1=\lastreadfilename\relax}%
  483. % % will have an unusual catcode below; use * instead
  484. {\catcode`\%=12\catcode`\*=14
  485. \gdef\splitfile#1{*
  486.  \readfilename#1\relax
  487.  \immediate\openin\j@insplitin=\lastreadfilename\relax
  488.  \ifeof\j@insplitin
  489.    \message{! I couldn't find and split \lastreadfilename!}*
  490.  \else
  491.    \immediate\openout\j@insplitout=TrashMe
  492.    \message{< Splitting \lastreadfilename\space into}*
  493.    \loop
  494.      \ifeof\j@insplitin
  495.        \immediate\closein\j@insplitin\n@teoffalse
  496.      \else
  497.        \n@teoftrue
  498.        \executeinspecs{\global\read\j@insplitin to\spl@tinline\expandafter
  499.          \ch@ckbeginnewfile\spl@tinline%Beginning-Of-File-Named:%\endcheck}*
  500.        \ifc@ntrolline
  501.        \else
  502.          \toks0=\expandafter{\spl@tinline}*
  503.          \immediate\write\j@insplitout{\the\toks0}*
  504.        \fi
  505.      \fi
  506.    \ifn@teof\repeat
  507.    \immediate\closeout\j@insplitout
  508.  \fi\message{>}*
  509. }*
  510. \gdef\ch@ckbeginnewfile#1%Beginning-Of-File-Named:#2%#3\endcheck{*
  511.  \def\t@mp{#1}*
  512.  \ifx\@mpty\t@mp
  513.    \def\t@mp{#3}*
  514.    \ifx\@mpty\t@mp
  515.      \global\c@ntrollinefalse
  516.    \else
  517.      \immediate\closeout\j@insplitout
  518.      \warnopenout\j@insplitout{#2}*
  519.      \global\c@ntrollinetrue
  520.    \fi
  521.  \else
  522.    \global\c@ntrollinefalse
  523.  \fi}*
  524. \gdef\joinfiles#1\into#2{*
  525.  \message{< Joining following files into}*
  526.  \warnopenout\j@insplitout{#2}*
  527.  \message{:}*
  528.  {*
  529.  \edef\w@##1{\immediate\write\j@insplitout{##1}}*
  530. \w@{% This collection of files was produced with CERN psbox package}*
  531. \w@{% To decompose and tex it:}*
  532. \w@{%-save this with a filename CONTAINING ONLY LETTERS and a .TEX}*
  533. \w@{% extension (say, JOINTFIL.TEX), in some empty directory;}*
  534. \w@{%-make sure you can \string\input\space psbox.tex (version>=1.3);}*
  535. \w@{%  (else ftp cs.nyu.edu(=128.122.140.24):pub/TeX/psbox/, then get}*
  536. \w@{%  and tex the file psboxall.tex; more info in psbREAD.ME)}*
  537. \w@{%-tex JOINTFIL.TEX using Plain, or LaTeX, or whatever is needed by}*
  538. \w@{%  the first file in the joining (after splitting JOINTFIL.TEX into}*
  539. \w@{%  it's constituents, TeX will try to process it as it stands).}*
  540. \w@{\string\input\space psbox.tex}*
  541. \w@{\string\splitfile{\string\jobname}}*
  542. \w@{\string\let\string\autojoin=\string\relax}*
  543. }*
  544.  \expandafter\tre@tfilelist#1, \endtre@t
  545.  \immediate\closeout\j@insplitout
  546.  \message{>}*
  547. }*
  548. \gdef\tre@tfilelist#1, #2\endtre@t{*
  549.  \readfilename#1\relax
  550.  \ifx\@mpty\lastreadfilename
  551.  \else
  552.    \immediate\openin\j@insplitin=\lastreadfilename\relax
  553.    \ifeof\j@insplitin
  554.      \errmessage{I couldn't find file \lastreadfilename}*
  555.    \else
  556.      \message{\lastreadfilename}*
  557.      \immediate\write\j@insplitout{%Beginning-Of-File-Named:\lastreadfilename}*
  558.      \executeinspecs{\global\read\j@insplitin to\oldj@ininline}*
  559.      \loop
  560.        \ifeof\j@insplitin\immediate\closein\j@insplitin\n@teoffalse
  561.        \else\n@teoftrue
  562.          \executeinspecs{\global\read\j@insplitin to\j@ininline}*
  563.          \toks0=\expandafter{\oldj@ininline}*
  564.          \let\oldj@ininline=\j@ininline
  565.          \immediate\write\j@insplitout{\the\toks0}*
  566.        \fi
  567.      \ifn@teof
  568.      \repeat
  569.    \immediate\closein\j@insplitin
  570.    \fi
  571.    \tre@tfilelist#2, \endtre@t
  572.  \fi}*
  573. }%
  574. % To be put at the end of a file, for making a tar-like file containing
  575. %   everything it used.
  576. \def\autojoin{%
  577.  \immediate\write\psbj@inaux{\string\into{psbjoint.tex}}%
  578.  \immediate\closeout\psbj@inaux
  579.  \expandafter\joinfiles\GlobalInputList\into{psbjoint.tex}%
  580. }%
  581. %----------------------------------------------------------------
  582. %  Annotations & Captions etc...
  583. %
  584. %
  585. % \centinsert{anybox} is just a centered \midinsert, but is included as
  586. %    people barely use the original inserts from TeX.
  587. %
  588. \def\centinsert#1{\midinsert\line{\hss#1\hss}\endinsert}%
  589. \def\psannotate#1#2{\vbox{%
  590.   \def\ps@nnotation{#2\global\let\ps@nnotation=\relax}#1}}%
  591. \def\pscaption#1#2{\vbox{%
  592.    \setbox\drawingBox=#1
  593.    \copy\drawingBox
  594.    \vskip\baselineskip
  595.    \vbox{\hsize=\wd\drawingBox\setbox0=\hbox{#2}%
  596.      \ifdim\wd0>\hsize
  597.        \noindent\unhbox0\tolerance=5000
  598.     \else\centerline{\box0}%
  599.     \fi
  600. }}}%
  601. % for compatibility with older versions, but \psfig is a bad name!
  602. %\def\psfig#1#2#3{\pscaption{\psannotate{#1}{#2}}{#3}}
  603. %\def\psfigurebox#1#2#3{\pscaption{\psannotate{\psbox{#1}}{#2}}{#3}}
  604. %
  605. % \at(#1;#2)#3 puts #3 at #1-higher and #2-right of the current
  606. %    position without moving it (to be used in annotations).
  607. \def\at(#1;#2)#3{\setbox0=\hbox{#3}\ht0=0pt\dp0=0pt
  608.   \rlap{\kern#1\vbox to0pt{\kern-#2\box0\vss}}}%
  609. %
  610. % \gridfill(ht;wd) makes a 1cm*1cm grid of ht by wd whose lower-left
  611. %   corner is the current point
  612. \newdimen\gridht \newdimen\gridwd
  613. \def\gridfill(#1;#2){%
  614.   \setbox0=\hbox to 1\pscm
  615.   {\vrule height1\pscm width.4pt\leaders\hrule\hfill}%
  616.   \gridht=#1
  617.   \divide\gridht by \ht0
  618.   \multiply\gridht by \ht0
  619.   \gridwd=#2
  620.   \divide\gridwd by \wd0
  621.   \multiply\gridwd by \wd0
  622.   \advance \gridwd by \wd0
  623.   \vbox to \gridht{\leaders\hbox to\gridwd{\leaders\box0\hfill}\vfill}}%
  624. %
  625. % Useful to measure where to put annotations
  626. \def\fillinggrid{\at(0cm;0cm){\vbox{%
  627.   \gridfill(\drawinght;\drawingwd)}}}%
  628. %
  629. % \textleftof\anybox: Sample text\endtext
  630. %   inserts "Sample text" on the left of \anybox ie \vbox, \psbox.
  631. %   \textrightof is the symmetric (not documented, too uggly)
  632. % Welcome any suggestion about clean wraparound macros from
  633. %   TeXhackers reading this
  634. %
  635. \def\textleftof#1:{%
  636.   \setbox1=#1
  637.   \setbox0=\vbox\bgroup
  638.     \advance\hsize by -\wd1 \advance\hsize by -2em}%
  639. \def\textrightof#1:{%
  640.   \setbox0=#1
  641.   \setbox1=\vbox\bgroup
  642.     \advance\hsize by -\wd0 \advance\hsize by -2em}%
  643. \def\endtext{%
  644.   \egroup
  645.   \hbox to \hsize{\valign{\vfil##\vfil\cr%
  646. \box0\cr%
  647. \noalign{\hss}\box1\cr}}}%
  648. %
  649. % \frameit{\thick}{\skip}{\anybox}
  650. %    draws with thickness \thick a box around \anybox, leaving \skip of
  651. %    blank around it. eg \frameit{0.5pt}{1pt}{\hbox{hello}}
  652. % \boxit{\anybox} is a shortcut.
  653. \def\frameit#1#2#3{\hbox{\vrule width#1\vbox{%
  654.   \hrule height#1\vskip#2\hbox{\hskip#2\vbox{#3}\hskip#2}%
  655.         \vskip#2\hrule height#1}\vrule width#1}}%
  656. \def\boxit#1{\frameit{0.4pt}{0pt}{#1}}%
  657. %
  658. %
  659. \catcode`\@=12 % cs containing @ are unreachable
  660. %
  661. % CUSTOMIZE YOUR DEFAULT DRIVER:
  662. %    Uncomment the line corresponding to your TeX system:
  663. \psfortextures%     For TeXtures on the Macintosh
  664. %\psforoztex   %     For OzTeX shareware on the Macintosh
  665. %\psfordvitops %     For the DVItoPS converter for TeX on IBM mainframes
  666. %\psfordvips   %     For DVIPS converter on VAX and UNIX
  667. %\psfordvitps  %     For dvitps from TeXPS package under UNIX
  668. %\psfordvialw  %     For dvialw, UNIX public domain
  669. %\psonlyboxes  %     Blank Boxes (when all else fails).
  670. %Beginning-Of-File-Named:TrashMe
  671. %\nowarnopenout
  672. \splitfile{\jobname}%
  673. \let\autojoin=\relax
  674. %Beginning-Of-File-Named:psbsamp.tex
  675. % psbsamp.tex V-1.3: a sample use of the psbox macros from Plain TeX.
  676. %2345678 1 345678 2 345678 3 345678 4 345678 5 345678 6 345678 7 3456789
  677. %
  678. \input psbox.tex % 'told you it was necessary!
  679. %
  680. %
  681. % These are just to get a mini verbatim:
  682.   \def\\{\hbox{$\backslash$}}%
  683.   \edef\{{\hbox{$\{$}}%
  684.   \edef\}{\hbox{$\}$}}%
  685. \def\section#1{\ifnum\pageno=1\else\vfil\break\fi
  686.   \centerline{\frameit{1pt}{2pt}{\frameit{0.5pt}{3pt}{\hbox{#1}}}}%
  687.   \nobreak\medskip}%
  688. \def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{a}\kern-.15em
  689.     T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}%
  690. %
  691. %
  692. \line{\hfil
  693. \frameit{1pt}{2pt}{\frameit{0.5pt}{3pt}{\hbox{PS}}}
  694. \frameit{1pt}{2pt}{\frameit{0.5pt}{3pt}{\hbox{BOX}}}
  695. \hfil \llap{V-\psboxversion, by Jean Orloff}}
  696. \line{\sevenrm e-mail: FE8 @ IX.URZ.UNI-HEIDELBERG.DE\hfil
  697. Updates available by anonymous ftp from:
  698. cs.nyu.edu:pub/TeX/psbox/%;\hfil noa.huji.ac.il
  699. }
  700. \bigbreak
  701. \section{Crash Overview}
  702. {\def\nl{\hfil\break}\parindent=0pt\parskip=3ptplus3pt\def\im{\parindent=1cm}
  703. WHAT IS IT:\nl
  704. psbox is a set of machine-independent TeX macros to:
  705. {\im
  706. \item{1)\ }allow (Encapsulated) PostScript figure inclusion in all versions
  707.    of TeX (Plain, LaTeX) on all machines using a PostScript printer
  708.  
  709. \item{2)\ }facilitate the communication (e-mail, ftp, ...) of all the files
  710.    (text, macros, figs) needed to reproduce a TeX document by grouping
  711.    them together into a single, TeXable file.
  712.  
  713. \bigskip
  714. \noindent HOW TO GET IT TO WORK:
  715. \item{1)\ }get the file psboxall.tex by one of the following ways:\nl
  716.    -from outside CERN: ftp cs.nyu.edu(=128.122.140.24):pub/TeX/psbox/\nl
  717.    -(if all else fails) send me a mail (fe8@ix.urz.uni-heidelberg.de);
  718. \item{2)\ }tex psboxall.tex: this will produce a complete documentation
  719. dvi and a
  720.    set of files, including the raw macros named psbox.tex;
  721. \item{3)\ }adapt your psbox.tex to your system by uncommenting the appropriate
  722.    {\tt\%\\psfor...}-line at the end of the file;
  723. \item{4)\ }put it in your TeX Inputs directory
  724. }
  725.  
  726. \bigskip
  727. MAJOR COMMANDS:
  728.  
  729. \def\tag#1{\noindent\hbox{\tt #1\hss}\nl\hangindent1cm}
  730. \tag{\\psbox\{fname.eps\}}
  731.    makes a box having the right size to enclose the figure fname.eps;
  732.  
  733. \tag{\\psboxto(xdim;ydim)\{fn.eps\}}
  734.    makes a box of the given size and rescales fn.eps so that it just fits;
  735.  
  736. \tag{\\psboxto(\\hsize;0pt)\{fn.eps\}}
  737.    has the maximal width \& a height computed from a uniformal rescaling;
  738.  
  739. \tag{\\centinsert\{\\pscaption\{\\psbox\{fn.eps\}\}\{Fig 1: the
  740. caption...\}\}}
  741.    recommended way to include a graphics between 2 paragraphs;
  742.  
  743. \tag{\\begin\{figure\}[hbt]\\begin\{center\}\\mbox\{\\psbox\{fn.eps\}\}\\caption\{Fig
  744. 1:\} \\end\{figure\}}
  745.    recommended way in LaTeX;
  746.  
  747. \tag{\\autojoin}
  748.    makes a single file called psbjoint.tex containing the currently tex'd
  749.    file plus all the files (macros \& figs) included since the \\input of
  750.    psbox.tex. Texing psbjoint.tex will split it into all these files with
  751.    their original names (so think of PC's:12345678.123!!) and tex the
  752.    first one (generally the one that issued \\autojoin).
  753.  
  754. }
  755. \vfill\break
  756. \section{Introduction}
  757. \TeX{} and PostScript have become de-facto standards for
  758. producing scientific papers and figures. The reason for this perhaps
  759. lies in the success of electronic mail within the scientific
  760. community as both standards produce text files that easily propagate by
  761. e-mail and yet produce machine-independent result when printed from any
  762. computer on any PostScript printer\footnote{*}{You might think of
  763. sending directly the PostScript description of the whole document, but
  764. this would mean sending 15 times more caracters and moreover
  765. forbidding your correspondant to make any correction to the
  766. manuscript.}. Recently, these standards have been further sanctified in
  767. the Physics community with the advent of electronic ``Bulletin Boards"
  768. which spread like crazy and whose very existence precisely relies on
  769. such standards.
  770.  
  771. In this rapidly evolving and modernish landscape, the
  772. inclusion of figures into papers still remains a dark spot: it is
  773. relatively uneasy and, worse, essentially non-universal. The purpose of the
  774. {\tt psbox} macros is to try and correct for this.
  775.  
  776. To start with, let us show how to use the macros for including
  777. Encapsulated PostScript graphics-File (EPSF) into any \TeX\ document
  778. (Plain \TeX, Plain-based macros like Harvmac, Phyzzx,... or \LaTeX).
  779. To get this to work, you first need to produce an EPSF. This
  780. is different from a usual PostScript file. (For instance, with CERN's
  781. package PAW/HIGZ, the output device specified in the metafile is -111
  782. for simple postscript and -113 for EPSF). You can always check whether
  783. you succeeded by looking at your EPSF: it should start with {\tt\%!}
  784. and somewhere contain a line like:
  785. $$
  786. \hbox{\tt\%\%BoundingBox: llx lly urx ury\hfil}
  787. $$
  788. where llx \& lly (urx \& ury) are the positive integer coordinates of
  789. the lower-left (upper-right) corners of the smallest rectangle enclosing
  790. your graphics. If all else fails, you still have the opportunity of
  791. adding such a line by hand: you might then want to know that
  792. coordinates are given in ``Big Points'' (1in=72bp)%
  793. \footnote{**}{%
  794. Not to be confused with ``Points'' (1in=72.27pt): inventing units
  795. related by such crazy factors as 72.27/72 definitely is a perverse and
  796. deeply immoral sport!}
  797. from the bottom left
  798. corner of the printed page. You can always visualize the corresponding
  799. {\tt\%\%BoundingBox} using {\tt\\boxit} (see below). Once you have a
  800. good EPSF, you should save it in the same directory as the \TeX{}
  801. file in which you want to insert your graphics.
  802.  
  803. Now you're ready for inserting. Here is how to do:
  804. \item{1)} Check you have a copy of the file {\tt psbox.tex} somewhere on
  805.   your system. If you don't, get it by ``anonymous ftp'' from the site
  806.   {\tt cs.nyu.edu}. In the directory pub/TeX/psbox, you will find a file
  807.   called {\tt psboxall.tex} which is an ``archive'' containing the macros,
  808.   this documentation, a sample PostScript figure, etc... Just ``{\tt get}''
  809.   it by ftp, tex it on your system, and you will see how an archive splits
  810.   into it's original files.
  811. \item{2)} make sure the uncommented line at the end of the {\tt psbox.tex}
  812.   file corresponds to your particular way of translating \TeX{}
  813.   output into PostScript:
  814. $$\vbox{\halign{\tt\\ps#\hfil&\qquad#\hfil\cr
  815. fortextures& for TeXtures on the Macintosh\cr
  816. foroztex&    for OzTeX shareware soft on the Macintosh\cr
  817. fordvitops&  for IBM mainframes dvi to postscript converter DVITOPS\cr
  818. fordvips&    for Unix, PC and VAX dvi to postscript converter DVIPS\cr
  819. fordvitps&   for dvitps from the TeXPS package under UNIX.\cr
  820. fordvialw&   for Unix free converter (part GNU software)\cr
  821. onlyboxes&   for poor people without any of these\cr
  822. }}
  823. $$
  824. \item{3)} in the
  825.   beginning of your \TeX{} file, type {\tt\\input psbox.tex}
  826.   in order to load the relevant \TeX{} macros;
  827.  
  828.  
  829. If you get the wrong postscript
  830. converter, you will just get extremely white(!) figures but the
  831. formatting of your text will be exactly the same.
  832. Now you can get your graphics where you want in the text by
  833. just typing:
  834. $$
  835. \hbox{\tt\$\$\\psbox\{box.ps\}\$\$}
  836. $$
  837. And this is what you get:
  838. $$
  839. \psbox{box.ps}
  840. $$
  841. The {\tt\\psbox\{EPSFilename\}} macro makes a \TeX{} \\vbox
  842. having the right size to contain the graphics and issues a \\special
  843. command for the postscript printer to put the EPSF graphics at the
  844. right place.
  845.  
  846. \section{Scalings}
  847. You can moreover use Postscript to resize your graphics. This can be
  848. done via the {\tt\\psboxto} macro: here you
  849. specify the dimensions and \TeX{} uniformly scales the graphics to fit
  850. entirely in the given box. For instance
  851. $$\eqalign{\hbox{\tt\$\$}
  852. &\hbox{\tt\\boxit\{\\psboxto(3cm;7cm)\{box.ps\}\}}\cr
  853. &\hbox{\tt\\boxit\{\\psboxto(7cm;3cm)\{box.ps\}\}\$\$}\cr}
  854. $$
  855. gives
  856. $$
  857. \boxit{\psboxto(3cm;7cm){box.ps}}
  858. \boxit{\psboxto(7cm;3cm){box.ps}}
  859. $$
  860. (we have here materialized the \TeX boxes by the
  861. {\tt\\boxit\{anybox\}} command which can be useful for
  862. boxing not only psboxes, but any kind of text boxes. To
  863. control the thickness of the line and to have some white space
  864. between your box and it's framing, you can use
  865. {\tt\\frameit\{LineThickness\} \{WhiteSpaceThickness\} \{\\anybox\}}).
  866.  
  867. If you specify one zero dimension in {\tt\\psboxto}, you get a box
  868. proportional to the natural one for your drawing, but with the scale
  869. specified by the non-zero dimension: $$\eqalign{\hbox{\tt\$\$}
  870. &\hbox{\tt\\boxit\{\\psboxto(3cm;0cm)\{box.ps\}\}}\cr
  871. &\hbox{\tt\\boxit\{\\psboxto(0cm;3cm)\{box.ps\}\}\$\$}\cr} $$ yields
  872. $$ \boxit{\psboxto(3cm;0cm){box.ps}} \boxit{\psboxto(0cm;3cm){box.ps}}
  873. $$
  874. Altenatively, you can specify a scale factor%
  875. \footnote{*}{This way
  876. you can be sure to get exactly the same size for the \TeX{} and EPSF
  877. box: with {\tt\\psboxto}, you can have the \TeX box 1/1000 too large
  878. because of rounding errors unavoidable for compatibility reasons}
  879. ($\times1000$ in the usual \TeX{} way):
  880. $$\hbox{\tt\\psboxscaled\{250\}\{box.ps\}:}\psboxscaled{250}{box.ps}
  881. $$
  882. On certain occasions, the way PostScript computes it's BoundingBox may
  883. may be too conservative: the box turns out to be too large because of
  884. some invisible control point lying outside the visual bounding box.
  885. For most purposes, this won't harm. Certain perfectionists will
  886. nevertheless appreciate the possibility of correcting the bounding
  887. box by specifying an offset ({\tt\\psxoffset, \\psyoffset})
  888. for the lower left corner and incrementing the width and height
  889. ({\tt\\pswdincr, \\pshtincr}) of the graphics. For instance,
  890. $$\hbox{\tt\\psxoffset=1cm\\psyoffset=20pt\\pswdincr=1cm\\pshtincr=20pt}
  891. $$
  892. will {\bf raise} the figure by 12pt, shift it to the right by
  893. 0.3cm and change it's size so that it still fits. These dimensions
  894. get reset after each use of {\tt\\psbox...} so
  895. you should type this just before the one you want to modify. These
  896. dimensions also get scaled together with the figure if you later
  897. decide to
  898. use {\tt\\psboxto or \\psboxscaled}:
  899. $$
  900. \psxoffset=1cm\psyoffset=20pt
  901. \pswdincr=1cm\pshtincr=20pt
  902. \boxit{\psboxscaled{1200}{box.ps}}\kern2cm
  903. \psxoffset=1cm\psyoffset=20pt
  904. \pswdincr=1cm\pshtincr=20pt
  905. \boxit{\psboxto(3cm;0cm){box.ps}}
  906. $$
  907. Since a {\tt\\psbox} is a true \TeX box, nothing prevents you to have
  908. \psboxto(0cm;1em){box.ps} it in the middle of a line..(?) More
  909. seriously, if you want your graphics to be as large as possible, you
  910. can type
  911. $$\hbox{\tt\$\$\\psboxto(\\hsize;0cm)\{box.ps\}\$\$}
  912. $$
  913. which gives
  914. $$\psboxto(\hsize;0cm){box.ps}
  915. $$
  916.  
  917. \section{Annotations}
  918. For certain figures, you might want to add something on top of the
  919. graphics (eg. a greek letter to name an axis, or other math symbols
  920. you use in the text). This is what
  921. {\tt\\psannotate\{\\psbox...\}\{annotation\}} was made for. For
  922. instance if you type
  923. $$\hbox{\tt\$\$%
  924. \\psannotate\{\\psboxto(10cm;3cm)\{box.ps\}\}%
  925. \{\\fillinggrid\\at(3\\pscm;1\\pscm)\{A sample at.\}\}\$\$}
  926. $$
  927. you get
  928. $$\psannotate{\psboxto(10cm;3cm){box.ps}} {\fillinggrid
  929. \at(3\pscm;1\pscm){A sample at.}}
  930. $$
  931. This example displays the 2 possible annotations:
  932. \item{-}{\tt\\at((xdim;ydim)\{annotation text\}} will place {\tt
  933. annotation text} xdim to the right of, and ydim higher than the
  934. current point without actually moving it (this may prove useful in
  935. other circumstances). The dimensions may be expressed in any valid
  936. \TeX{} unit, but here we used {\tt\\pscm} meaning scaled centimeters
  937. in order for the annotation to keep the same relative position inside
  938. the figure, whatever rescaling you might do later on.
  939.  
  940. \item{-}{\tt\\fillinggrid}: in order to help you in the tedious task
  941. of determining the position of your annotations, you can use
  942. {\tt\\fillinggrid} as one particular annotation. This will produce a
  943. 1\\pscm by 1\\pscm grid that roughly fills your figure. You will of
  944. course have to delete these in your final document\footnote{*} {To
  945. suppress all these grids at once in your final document, you may type
  946. {\tt\\let\\fillinggrid=\\relax} just after the line where you
  947. {\tt\\input psbox.tex}.}.
  948.  
  949. \section{Figure Environment For Plain\TeX}
  950. If you have many large figures, the probability that \TeX{}
  951. barks at you about ``overfull or underfull vbox...'' becomes
  952. significant, because you give it a hard time trying to cut pages
  953. into a document that has many large unbreakable units. To
  954. overcome this problem, La\TeX{} users simply have to type:\hfil\break
  955. {\tt\\begin\{figure\}[hbt]\hfil\break
  956. \\begin\{center\}\\mbox\{\\psbox...\}\\end\{center\}\hfil\break
  957. \\caption\{Some caption\}\hfil\break \\end\{figure\}\hfil\break}
  958. In Plain\TeX{} you should use
  959. {\tt\\centinsert\{\\psbox...\}} instead of {\tt\$\$\\psbox...\$\$}.
  960. This will get your graphics precisely where you typed it except if
  961. there is not enough room in the current page, in which case you'll get
  962. it on top of the next one.
  963.  
  964. However, you will then probably want to have a caption, in case your
  965. graphics and explanatory text get separated. You should then
  966. use {\tt\\pscaption\{\\psbox...\}\{caption\}}, for instance
  967. $$\vbox{\hsize=10cm\tt\hbox{
  968. \\centinsert\{%
  969.   \\pscaption\{%
  970.     \\psannotate\{%
  971.       \\psboxto(6cm;0cm)\{box.ps\}\}\{%
  972. }
  973. \hbox{\qquad\\fillinggrid\\at(3\\pscm;1\\pscm)\{A sample at.\}\}\}\{%
  974.     Figure 1: this is ...
  975. \}\}
  976. }}
  977. $$
  978. in order to get:
  979. \centinsert{
  980.   \pscaption{
  981.     \psannotate{
  982.       \psboxto(6cm;0cm){box.ps}}{
  983.       \fillinggrid\at(3\pscm;1\pscm){A sample at.}}}{%
  984.     Figure 1: this is probably the most stupid caption I can think of
  985.     but it can still be useful for illustrative purposes.
  986. }}%
  987. If your caption is short, it will automatically get centered:
  988. $$\pscaption{\psboxto(3cm;0cm){box.ps}}{\bf Figure 327.}
  989. $$
  990. When typing in the commands for catpion, annotations, etc, you may end
  991. up with long lines which you don't know how to break (a line break is
  992. essentially a space in \TeX, remember?). If you don't want these
  993. spurious spaces to sneek in your text, you should simply add \%{} just
  994. before the line break.
  995.  
  996. \section{Multiple Files Management}
  997. Suppose you now have a few figures together with a paper, plus your favorite 
  998. macros and reference files. You want to communicate the fruits of your hard
  999. work to the entire world, but you don't want to send ten separate files to
  1000. each collaborator/potentially interested scientist. So you create a "master"
  1001. file containing (you hope) all the files needed to re\TeX{} your paper. The
  1002. receiver will also have to do some electronic cutting and pasting. Very
  1003. quickly, it starts being a nuisance for everybody to assemble and disassemble
  1004. a large file into it's constituents. This is why I thought the following
  1005. macros might prove handy:
  1006.  
  1007. \item{a.}{\tt\\joinfiles filename1, filename2, ..., filenamen \\into%
  1008. \{JOINTFIL.TEX\}}\hfil\break
  1009. joins several files into a big one that can be split later on. Since
  1010. the goal here is universality, you should remember that PC's still form
  1011. the majority of personal computers, and they like filenames of the form
  1012. 12345678.123 where you can only replace digits by a letter (no
  1013. *,\&,\$,', etc...), without distinction between upper-case and
  1014. lower-case. So, if you want portability, save your texts as 
  1015. {\tt12345678.tex} and your figures as {\tt12345678.eps} (ie. no
  1016. empty extensions): this will save you from later troubles!
  1017. The file {\tt JOINTFIL.TEX} has a header explaining how to split
  1018. it (see below) and is in fact auto-splittable. Namely, you just have to
  1019. run \TeX, or \LaTeX{} depending of what is required by the first file in
  1020. the list. This should first split the file and then tex it while
  1021. including properly the figures. You can edit the ``archive'' {\tt
  1022. JOINTFIL.TEX}, for instance to change the header, or to modify the names
  1023. under which files will be stored when split. For this you may need to
  1024. know that each file in the archive has a header line containing it's
  1025. name, eg:\hfil\break
  1026. {\tt\%Beginning-Of-File-Named:box.ps}.
  1027.  
  1028. \item{b.} {\tt\\autojoin}:\hfil\break
  1029. since it is painful to remember the list of all figure's names, you can
  1030. generate a joint file called {\tt psbjoint.tex} by simply typing
  1031. {\tt\\autojoin} close to the end (ie. after all {\tt\\psbox...} and
  1032. {\tt\\input ...} have been issued) of the file you want to tex. This
  1033. will first close and then read in a file called {\tt psbjoin.aux} that is
  1034. always generated automatically and that basically contains the list of
  1035. all your inclusions (both figures and macro files {\tt\\input}ted). If
  1036. you never say {\tt\\autojoin}, the file {\tt psbjoin.aux} will
  1037. nevertheless be created and will by the end of the day contain the list
  1038. of files needed for your texing session. This list will appear as an
  1039. incomplete {\tt\\joinfiles}-command, which you can complete and tex to
  1040. do the joining. Notice: all these macro and figure files do not need to
  1041. be in the same directory to be found. If \TeX{} is able to find them
  1042. for {\tt\\input} or {\tt\\psbox} (because they are in some directory
  1043. named {\tt TeX Inputs} or pointed at by an environment variable {\tt
  1044. TEXINPUTS}), it will be able to join them too. Unix users should resist
  1045. the temptation of specifying explicit path in filenames (eg: {\tt
  1046. ../../TeX/mymacros.tex}): this makes their \TeX{} files non-portable.
  1047. They should rather add an entry in their {\tt TEXINPUTS} list of paths.
  1048.  
  1049. \item{c.}{\tt\\splitfile\{JOINTFIL.TEX\}}\hfil\break
  1050. splits {\tt JOINTFIL.TEX} into it's constituents. Anything before the
  1051. first {\tt\%Beginning-Of-File-Named:} line is trashed into a special
  1052. file called {\tt TrashMe}: never store precious info in such a file
  1053. anyhow!  You may fear what happens if one of the constituent-file
  1054. names coincides with a previoulsy existing file on your disk. Does it
  1055. silently replace it? Well, no, relax, all output produced by these
  1056. macros use {\tt\\warnopenout} instead of the standard {\tt\\openout},
  1057. which will give you a chance to break precisely in this case. Notice 
  1058. {\tt\\warnopenout} is sometimes too cautious: it can warn you before 
  1059. erasing a file that doesn't exist! This is because a file with the same
  1060. name exists in some directory \TeX{} is searching in for input files,
  1061. but relax, it will only write files in the same directory as {\tt
  1062. JOINTFIL.TEX}. Finally,
  1063. notice you can say {\tt\\splitfile \{\\jobname\}} in which case you will
  1064. split the very file that issued such a command (this is in fact what
  1065. makes the output of {\tt\\joinfiles} auto-splittable). However,
  1066. watchout: {\tt\\jobname} has peculiar and machine-dependent
  1067. definition. It gives the name of the file currently texed MINUS it's
  1068. {\tt.tex} extension if it has one (and on most machines, minus any
  1069. extension your filename could have). So, \TeX{} will not
  1070. be able to read in from the file named {\tt\\jobname} (without
  1071. extension). But it always tries to read in {\tt\\jobname.tex} (in fact,
  1072. on IBM \& VAX machines, it doesn't even try to read {\tt\\jobname}
  1073. without extension). This mess explains the
  1074. precaution taken in the header of a joint file, reproduced below:\hfil\break
  1075. {\obeylines\tt\def
  1076. {\hfil\break}
  1077. \% This collection of files was produced with CERN psbox package
  1078. \% To decompose and tex it:
  1079. \%-save this with a filename CONTAINING ONLY LETTERS and a .TEX
  1080. \% extension (say, JOINTFIL.TEX), in some empty directory;
  1081. \%-make sure you can \string\input\space psbox.tex (version>=1.3);
  1082. \%  (else ftp cs.nyu.edu(=128.122.140.24):pub/TeX/psbox/, then get
  1083. \%  and tex the file psboxall.tex; more info in psbREAD.ME)
  1084. \%-tex JOINTFIL.TEX using Plain, or LaTeX, or whatever is needed by
  1085. \%  the first file in the joining (after splitting JOINTFIL.TEX into
  1086. \%  it's constituents, TeX will try to process it as it stands).
  1087. \\input psbox.tex
  1088. \\splitfile\{\\jobname\}
  1089. \\let\\autojoin\\=\\relax
  1090. }
  1091. \joinfiles psbREAD.ME, psboxOK.tex\into{TrashMe}
  1092. \section{Errors}
  1093. \message{RELAX!!!
  1094. The following error messages should not frighten you, they are
  1095. intentional tests. Just continue and see what comes out!}
  1096. If \TeX{} cannot find the file you specified, you will get the following
  1097. output:
  1098. $$\psbox{in_exist.ps}$$
  1099. On the other hand, an existing file which is not EPSF will produce:
  1100. $$\psbox{psbsamp.tex}$$
  1101. \autojoin
  1102. \bye
  1103. %Beginning-Of-File-Named:box.ps
  1104. %!PS-Adobe-2.0 EPSF-1.2
  1105. %%Creator:Adobe Illustrator(TM) 3.0
  1106. %%For: (pascal) (ducul)
  1107. %%Title: (box.ps)
  1108. %%CreationDate: (8/5/92) (18:13)
  1109. %%DocumentProcessColors: Black
  1110. %%DocumentFonts: Helvetica-Oblique
  1111. %%+ Times-Roman
  1112. %%DocumentProcSets: Adobe_Illustrator_1.1 0 0
  1113. %%DocumentSuppliedProcSets: Adobe_Illustrator_1.1 0 0
  1114. %%BoundingBox:84 365 299 484
  1115. %%ColorUsage: Black&White
  1116. %%TemplateBox:288 360 288 360
  1117. %%TileBox: 0 0 538 781
  1118. %%DocumentPreview: Macintosh_Pic
  1119. %%EndComments
  1120. %%BeginProcSet:Adobe_Illustrator_1.1 0 0
  1121. % Copyright (C) 1987-1990 Adobe Systems Incorporated.
  1122. % All Rights Reserved.
  1123. % Adobe Illustrator is a trademark of Adobe Systems Incorporated.
  1124. /Adobe_Illustrator_1.1 dup 100 dict def load begin
  1125. /Version 0 def
  1126. /Revision 0 def
  1127. % definition operators
  1128. /bdef {bind def} bind def
  1129. /ldef {load def} bdef
  1130. /xdef {exch def} bdef
  1131. % graphic state operators
  1132. /_K {3 index add neg dup 0 lt {pop 0} if 3 1 roll} bdef
  1133. /_k /setcmybcolor where
  1134. {/setcmybcolor get} {{1 sub 4 1 roll _K _K _K setrgbcolor pop} bind} ifelse def
  1135. /g {/_b xdef /p {_b setgray} def} bdef
  1136. /G {/_B xdef /P {_B setgray} def} bdef
  1137. /k {/_b xdef /_y xdef /_m xdef /_c xdef /p {_c _m _y _b _k} def} bdef
  1138. /K {/_B xdef /_Y xdef /_M xdef /_C xdef /P {_C _M _Y _B _k} def} bdef
  1139. /d /setdash ldef
  1140. /_i currentflat def
  1141. /i {dup 0 eq {pop _i} if setflat} bdef
  1142. /j /setlinejoin ldef
  1143. /J /setlinecap ldef
  1144. /M /setmiterlimit ldef
  1145. /w /setlinewidth ldef
  1146. % path construction operators
  1147. /_R {.25 sub round .25 add} bdef
  1148. /_r {transform _R exch _R exch itransform} bdef
  1149. /c {_r curveto} bdef
  1150. /C /c ldef
  1151. /v {currentpoint 6 2 roll _r curveto} bdef
  1152. /V /v ldef
  1153. /y {_r 2 copy curveto} bdef
  1154. /Y /y ldef
  1155. /l {_r lineto} bdef
  1156. /L /l ldef
  1157. /m {_r moveto} bdef
  1158. % error operators
  1159. /_e [] def
  1160. /_E {_e length 0 ne {gsave 0 g 0 G 0 i 0 J 0 j 1 w 10 M [] 0 d
  1161. /Courier 20 0 0 1 z [0.966 0.259 -0.259 0.966
  1162. _e 0 get _e 2 get add 2 div _e 1 get _e 3 get add 2 div] e _f t T grestore} if} bdef
  1163. /_fill {{fill} stopped
  1164. {/_e [pathbbox] def /_f (ERROR: can't fill, increase flatness) def n _E} if} bdef
  1165. /_stroke {{stroke} stopped
  1166. {/_e [pathbbox] def /_f (ERROR: can't stroke, increase flatness) def n _E} if} bdef
  1167. % path painting operators
  1168. /n /newpath ldef
  1169. /N /n ldef
  1170. /F {p _fill} bdef
  1171. /f {closepath F} bdef
  1172. /S {P _stroke} bdef
  1173. /s {closepath S} bdef
  1174. /B {gsave F grestore S} bdef
  1175. /b {closepath B} bdef
  1176. % text block construction and painting operators
  1177. /_s /ashow ldef
  1178. /_S {(?) exch {2 copy 0 exch put pop dup false charpath currentpoint _g setmatrix
  1179. _stroke _G setmatrix moveto 3 copy pop rmoveto} forall pop pop pop n} bdef
  1180. /_A {_a moveto _t exch 0 exch} bdef
  1181. /_L {0 _l neg translate _G currentmatrix pop} bdef
  1182. /_w {dup stringwidth exch 3 -1 roll length 1 sub _t mul add exch} bdef
  1183. /_z [{0 0} bind {dup _w exch neg 2 div exch neg 2 div} bind {dup _w exch neg exch neg} bind] def
  1184. /z {_z exch get /_a xdef /_t xdef /_l xdef exch findfont exch scalefont setfont} bdef
  1185. /_g matrix def
  1186. /_G matrix def
  1187. /_D {_g currentmatrix pop gsave concat _G currentmatrix pop} bdef
  1188. /e {_D p /t {_A _s _L} def} bdef
  1189. /r {_D P /t {_A _S _L} def} bdef
  1190. /a {_D /t {dup p _A _s P _A _S _L} def} bdef
  1191. /o {_D /t {pop _L} def} bdef
  1192. /T {grestore} bdef
  1193. % group construction operators
  1194. /u {} bdef
  1195. /U {} bdef
  1196. % font construction operators
  1197. /Z {findfont begin currentdict dup length dict begin
  1198. {1 index /FID ne {def} {pop pop} ifelse} forall /FontName exch def dup length 0 ne
  1199. {/Encoding Encoding 256 array copy def 0 exch {dup type /nametype eq
  1200. {Encoding 2 index 2 index put pop 1 add} {exch pop} ifelse} forall} if pop
  1201. currentdict dup end end /FontName get exch definefont pop} bdef
  1202. end
  1203. %%EndProcSet
  1204. %%EndProlog
  1205. %%BeginSetup
  1206. Adobe_Illustrator_1.1 begin
  1207. n
  1208. %%BeginEncoding: _Helvetica-Oblique Helvetica-Oblique
  1209. [39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
  1210. /Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
  1211. /egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
  1212. /oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
  1213. /udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
  1214. /registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
  1215. /.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
  1216. /.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
  1217. /questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
  1218. /guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
  1219. /endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
  1220. /.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
  1221. /fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
  1222. /Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
  1223. /Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
  1224. /Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
  1225. /hungarumlaut/ogonek/caron
  1226. ]/_Helvetica-Oblique/Helvetica-Oblique Z
  1227. %%EndEncoding
  1228. %%BeginEncoding: _Times-Roman Times-Roman
  1229. [39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
  1230. /Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
  1231. /egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
  1232. /oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
  1233. /udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
  1234. /registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
  1235. /.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
  1236. /.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
  1237. /questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
  1238. /guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
  1239. /endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
  1240. /.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
  1241. /fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
  1242. /Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
  1243. /Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
  1244. /Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
  1245. /hungarumlaut/ogonek/caron
  1246. ]/_Times-Roman/Times-Roman Z
  1247. %%EndEncoding
  1248. %%EndSetup
  1249. u
  1250. 0.5 g
  1251. 0 G
  1252. 0 i 0 J 1 j 1 w 4 M [3 2 ]0 d
  1253. %%Note:
  1254. 297 366 m
  1255. 297 483 L
  1256. 86 483 L
  1257. 86 366 L
  1258. 297 366 L
  1259. b
  1260. 191.5 424.5 m
  1261. B
  1262. U
  1263. u
  1264. 1 g
  1265. 0 j 0.3 w []0 d
  1266. 191.5 365.9999 m
  1267. 249.7652 365.9999 297.0001 392.1918 297.0001 424.5 c
  1268. 297.0001 456.8082 249.7652 483.0001 191.5 483.0001 c
  1269. 133.2347 483.0001 85.9999 456.8082 85.9999 424.5 c
  1270. 85.9999 392.1918 133.2347 365.9999 191.5 365.9999 c
  1271. b
  1272. 191.5 424.5 m
  1273. B
  1274. U
  1275. u
  1276. u
  1277. u
  1278. 0 g
  1279. 1 w
  1280. /_Helvetica-Oblique 10 12 0 2 z
  1281. [1 0 0 1 212 445]e
  1282. (Postscript box:)t
  1283. T
  1284. U
  1285. U
  1286. u
  1287. u
  1288. /_Times-Roman 12 12 0 2 z
  1289. [1 0 0 1 212 433]e
  1290. ()t
  1291. (Sometimes surrounded)t
  1292. T
  1293. U
  1294. U
  1295. u
  1296. u
  1297. /_Times-Roman 12 12 0 0 z
  1298. [1 0 0 1 138.0166 409]e
  1299. ( by a T)t
  1300. T
  1301. U
  1302. U
  1303. u
  1304. u
  1305. /_Times-Roman 12 12 0 0 z
  1306. [1 0 0 1 171.6728 406]e
  1307. (E)t
  1308. T
  1309. U
  1310. U
  1311. u
  1312. u
  1313. /_Times-Roman 12 12 0 0 z
  1314. [1 0 0 1 179.0029 409]e
  1315. (X box:)t
  1316. T
  1317. U
  1318. U
  1319. U
  1320. 0 G
  1321. 1 j [3 2 ]0 d
  1322. 226 448 m
  1323. 276 448 l
  1324. S
  1325. []0 d
  1326. 225.5 410.5 m
  1327. 275.5 410.5 l
  1328. S
  1329. %%PageTrailer
  1330. %%Trailer
  1331. _E end
  1332. %%EOF
  1333. %Beginning-Of-File-Named:psbREAD.ME
  1334. %                           PSBOX READ-ME
  1335. %                           -------------
  1336. % WHAT IS IT:
  1337. % psbox is a set of machine-independent TeX macros to
  1338. % 1) allow (Encapsulated) PostScript figure inclusion in all versions
  1339. %    of TeX (Plain, LaTeX) on all machines using a PostScript printer
  1340. % 2) facilitate the communication (e-mail, ftp, ...) of all the files
  1341. %    (text, macros, figs) needed to reproduce a TeX document by grouping
  1342. %    them together into a single, TeXable file.
  1343. %
  1344. % HOW TO GET IT TO WORK:
  1345. % 1) get the file psboxall.tex by one of the following ways:
  1346. %    -from outside CERN: ftp cs.nyu.edu(=128.122.140.24):pub/TeX/psbox/
  1347. %    -(if all else fails) send me a mail (fe8@ix.urz.uni-heidelberg.de);
  1348. % 2) tex psboxall.tex: this will produce a complete documentation dvi and a
  1349. %    set of files, including the raw macros named psbox.tex;
  1350. % 3) adapt your psbox.tex to your system by uncommenting the appropriate
  1351. %    %\psfor...-line at the end of the file;
  1352. % 4) put it in your TeX Inputs directory
  1353. %
  1354. % MAJOR COMMANDS:
  1355. % \psbox{fname.eps}
  1356. %    makes a box having the right size to enclose the figure fname.eps;
  1357. % \psboxto(xdim;ydim){fn.eps}
  1358. %    makes a box of the given size and rescales fn.eps so that it just fits;
  1359. % \psboxto(\hsize;0pt){fn.eps}
  1360. %    has the maximal width & a height computed from a uniformal rescaling;
  1361. % \centinsert{\pscaption{\psbox{fn.eps}}{Fig 1: the caption...}}
  1362. %    recommended way to include a graphics between 2 paragraphs;
  1363. % \begin{figure}[hbt]\begin{center}\mbox{\psbox{fn.eps}}\caption{Fig 1:}
  1364. % \end{figure}
  1365. %    recommended way in LaTeX;
  1366. % \autojoin
  1367. %    makes a single file called psbjoint.tex containing the currently tex'd
  1368. %    file plus all the files (macros & figs) included since the \input of
  1369. %    psbox.tex. Texing psbjoint.tex will split it into all these files with
  1370. %    their original names (so think of PC's:12345678.123!!) and tex the
  1371. %    first one (generally the one that issued \autojoin).
  1372. %Beginning-Of-File-Named:psbug.tex
  1373.                    PSBOX bug-report form
  1374.                    ---------------------
  1375. From: 
  1376. To: fe8@ix.urz.uni-heidelberg.de (Jean Orloff)
  1377. Subject: psbox BUG
  1378.  
  1379. YOU     Name:
  1380.         Email:
  1381. PSBOX   version no:
  1382.         source:
  1383. MACHINE type: (NeXT, Mac LC,...)
  1384.         Operating system:
  1385. TEX     name:
  1386.         version:
  1387. TEX->PS name: (dvips, TeXtures,...)
  1388.         version:
  1389. DRAWING program: (Adobe Illustrator, xfig,...)
  1390.         version:
  1391. PRINTER type:
  1392.     PostScript version:
  1393. PREVIEW for postscript (if any): (ghostscript,...)
  1394.  
  1395. Command(s) incriminated: (\psbox,\splitfile,...)
  1396. Problem description:
  1397.  
  1398.  
  1399.  
  1400.  
  1401. Log (TeX, TeX->PS, Printer) file(s) where you got insulted:
  1402.  
  1403. %Beginning-Of-File-Named:psboxOK.tex
  1404.                    PSBOX ANTI-bug report form
  1405.                    --------------------------
  1406. From: 
  1407. To: fe8@ix.urz.uni-heidelberg.de (Jean Orloff)
  1408. Subject: psbox ANIT-BUG
  1409.  
  1410. PSBOX has been checked to work in the following environment:
  1411.  
  1412. MACHINE        TEX        TEX->PS        PRINTER/PREVIEWER
  1413. -------        ---        -------        -----------------
  1414. Macintosh*.*    TeXtures*.*            Apple LaserWriter (ALW)
  1415. "        OzTeX 1.3            ALW
  1416. UniX workst:    TeX 3.14t3    dvips 5.47    ALW
  1417.  SUN4        "        "        ALW
  1418.  NeXT        "        "        Preview
  1419.         "        dvialw        ALW
  1420. IBM370(VM/CMS)    TeX3.14/CMS1.3    DVItoPS        ALW
  1421. "        "        dvips 5.483    ALW
  1422. DOS PC        emTeX        dvips        GhostScript
  1423. Macintosh IIsi  OzTeX 1.5                       QMS-PS 1700
  1424.  
  1425. If your system is not listed here but nevertheless works fine, please
  1426. add in a line, fill in the detailed form below and send it to me.
  1427.     
  1428. YOU     Name:
  1429.         Email:
  1430. PSBOX   version no:
  1431.         source:
  1432. MACHINE type: (NeXT, Mac LC,...)
  1433.         Operating system:
  1434. TEX     name:
  1435.         version:
  1436. TEX->PS name: (dvips, TeXtures,...)
  1437.         version:
  1438. DRAWING program: (Adobe Illustrator, xfig,...)
  1439.         version:
  1440. PRINTER type:
  1441.     version of PostScript used:
  1442. PREVIEW for postscript (if any): (ghostscript,...)
  1443.